﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WPP_Service.Data;
using System.Data.SqlClient;

namespace WPP_Service.Test
{
    [TestClass]
    public class UpdateServiceTest
    {
        [TestMethod]
        public void TestUpdatePackage()
        {
            /*
            WPPService service = new WPPService();
            Package obj = service.GetPackage(4);
            obj.Complete = true;
            InvokeResponse response = service._UpdatePackage(obj);
            Assert.IsNotNull(response);
            Package updateObj = service.GetPackage(4);
            Assert.AreEqual(true, updateObj.Complete);

            obj = service.GetPackage(19);
            obj.Complete = true;
            response = service._UpdatePackage(obj);
            Assert.IsNotNull(response);
            updateObj = service.GetPackage(19);
            Assert.AreEqual(true, updateObj.Complete);
            obj = service.GetPackage(5);
            obj.Complete = true;
            response = service._UpdatePackage(obj);
            Assert.IsNotNull(response);
            updateObj = service.GetPackage(5);
            Order updatedOrder = service.GetOrder(11);
            Assert.AreEqual(true, updateObj.Complete);
            Assert.AreEqual(true, updatedOrder.Complete);
             * */
        }

        [TestMethod]
        public void TestUpdateOrder()
        {
            /*
            WPPService service = new WPPService();
            Order obj = service.GetOrder(11);
            obj.Complete = true;
            InvokeResponse response = service._UpdateOrder(obj);
            Assert.IsNotNull(response);
            Order updatedObj = service.GetOrder(11);
            Assert.AreEqual(true, updatedObj.Complete);
            foreach (Package p in updatedObj.Packages)
            {
                Assert.AreEqual(true, p.Complete);
            }

            obj = service.GetOrder(29);
            obj.Complete = true;
            response = service._UpdateOrder(obj);
            Assert.IsNotNull(response);
            updatedObj = service.GetOrder(11);
            Assert.AreEqual(true, updatedObj.Complete);
            foreach (Package p in updatedObj.Packages)
            {
                Assert.AreEqual(true, p.Complete);
            }
             * 
             */
        }
    }
}
